import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity('users')
export class UserPO {
  @PrimaryGeneratedColumn({ unsigned: true })
  id: number;

  @Column({ length: 50, unique: true })
  username: string;

  @Column({ length: 50, nullable: true })
  nickname: string;

  @Column({ length: 255 })
  password: string;

  @Column({ length: 255, nullable: true })
  avatar: string;

  @CreateDateColumn({ name: 'created_at' })
  createdAt: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt: Date;
}
